#include"include.h"
#include "lslc_class.h"
#include "sys_types.h"
#include "dl_dev.h"
#include "hw_radio.h"
extern  t_ctrl_reg_shadow _ctrl_reg_shadow;
void LSLCacc_Set_Am_Addr(t_am_addr am_addr)
{
    t_ctrl_reg_shadow *p_reg_shadow = &_ctrl_reg_shadow;
    mHWreg_Create_Cache_Register(JAL_COM_CTRL_GP1_REG);
    mHWreg_Assign_Cache_Register(JAL_COM_CTRL_GP1_REG, p_reg_shadow->gp1);
    mHWreg_Assign_Cache_Field(JAL_COM_CTRL_GP1_REG,JAL_AM_ADDR, am_addr );
    mHWreg_Move_Cache_Register(JAL_COM_CTRL_GP1_REG, p_reg_shadow->gp1);
}
void LSLCacc_Build_AccessCode(const t_syncword *syncword)
{
    t_ctrl_reg_shadow *p_reg_shadow = &_ctrl_reg_shadow;
    p_reg_shadow->sync_low  = syncword->low;
    p_reg_shadow->sync_high = syncword->high;
}
void LSLCacc_Build_PacketHeader(const t_devicelink *pDevLink, t_packet packetType);
void LSLCacc_Build_FHS_Payload(t_devicelink *pDevLink);
void LSLCacc_Build_FHS_Payload_Ex(t_devicelink *pDevLink, t_clock native_clk);
void LSLCacc_Prepare_Rx_Connection(const t_devicelink *p_dev_link);
void LSLCacc_Prepare_Rx_Return_To_Piconet(const t_devicelink *p_dev_link);
void LSLCacc_Prepare_Tx_Rx_FHS(t_state context, u_int crc_hec_init);
//void LSLCacc_Prepare_Tx_Rx_Connection(const t_devicelink *p_dev_link,
void LSLCacc_Enable_Transmitter(void);
void LSLCacc_Disable_Transmitter(void);
void LSLCacc_Enable_Receiver(void);
void LSLCacc_Disable_Receiver(void);
void LSLCacc_Process_Rx_Header(t_devicelink *pDevLink);
void LSLCacc_Process_No_Rx_Packet(t_devicelink *pDevLink);
void LSLCacc_Extract_Packet(t_devicelink *pDevLink);
void LSLCacc_Process_RSSI(t_devicelink *p_dev_link);
void LSLCacc_Attempt_RSSI_Read(boolean);
